﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace LogisticsManagementSystem.Truck
{
    public partial class AddTruck : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {

            LogisticsModel.Truck truck = new LogisticsModel.Truck
            {
                Number = txtaccount.Value,
                Type= oldpassword.Value,
                Length= newpassword.Value,
                FK_TeamID= Convert.ToInt32(newpassword2.Value),
                State= Convert.ToByte(Password1.Value),
                BuyDate= Convert.ToDateTime(Password2.Value),
                Remark= Password3.Value
            };
            if (LogisticsBLL.TruckBLL.AddTruck(truck))
            {
                Response.Write("<script>alert('添加成功')</script>");

            }
            else
            {
                Response.Write("<script>alert('添加失败')</script>");

            }

        }
    }
}